package com.doctcloud.hisinfo.api.factory;

import com.doctcloud.common.core.domain.R;
import com.doctcloud.hisinfo.api.RemoteHisInpAdmService;
import com.doctcloud.hisinfo.histable.domain.inpadm.PatsInHospitalDo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;
@Component
public class RemoteHisInpAdmServiceFallbackFactory implements FallbackFactory<RemoteHisInpAdmService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteHisInpAdmServiceFallbackFactory.class);
    @Override
    public RemoteHisInpAdmService create(Throwable cause) {
        return new RemoteHisInpAdmService() {
            @Override
            public R<List<PatsInHospitalDo>> listpatsinhospital() {
                return R.fail("获取价表失败:" + cause.getMessage());
            }
        };
    }
}
